<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"><!--引入thymeleaf-->
<meta name="referrer" content="no-referrer" />
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>进入首页</title>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/index.css"/>
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">
</head>
<body class="body">
<!--导入navigation.html，内容是导航框-->
<div th:insert="~{navigation :: copy}"></div>
<!--首页展示的发现部分-->
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12 col-ss-12">
            <h2><span class="glyphicon glyphicon-list" aria-hidden="true"></span> 发现 </h2>
            <hr>
            <!--分页展示内容-->
            <div class="media" th:each="question:${pagination.data}" style="margin-top: 22px">
                <div class="media-left">
                    <a th:href="@{'/question/'+${question.id}}">
                        <img class="media-object img-circle picset"
                             th:src="${question.user.headpic}">
                    </a>
                </div>
                <div class="media-body">
                    <span style="margin-top: 10px;">
                        <h4 class="media-heading" style="font-size: 17px;">
                        <a th:href="@{'/question/'+${question.id}}" th:text="${question.title}"></a>
                        </h4>
                    </span>
                    <span class="common-list"><span th:text="${question.comment_count}"/> 个评论 • <span
                            th:text="${question.view_count}"/> 次浏览 • <span th:text="${question.like_count}"/>个点赞
                        <span th:text="${#dates.format(question.createtime,'yyyy-MM-dd')}" style="float: right;"></span></span>
                </div>
            </div>
            <!--展示底部的页码-->
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li th:if="${pagination.showfirst}">
                        <a href="/index?page=1" aria-label="Previous">
                            <span aria-hidden="true">&lt;&lt;</span>
                        </a>
                    </li>
                    <li th:if="${pagination.showPre}">
                        <a th:href="@{/index(page=${pagination.page - 1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li>
                    <li th:each="page:${pagination.pages}" th:class="${pagination.page==page}? 'active' : ''">
                        <a th:href="@{/index(page=${page})}" th:text="${page}"></a>
                    </li>
                    <li th:if="${pagination.shownext}">
                        <a th:href="@{/index(page=${pagination.page+1})}" aria-label="Next">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <li th:if="${pagination.showlast}">
                        <a th:href="@{/index(page=${pagination.totalpage})}" aria-label="Next">
                            <span aria-hidden="true">&gt;&gt;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
        <!--热门话题部分-->
        <div class="col-lg-3 col-md-12 col-sm-12 col-ss-12">
            <h3>站长</h3>
            <a href="https://ecs.console.aliyun.com/">
                <img class="adminicon" src="../img/aliyun.png">
            </a>
            <a href="https://www.bilibili.com/">
                <img class="adminicon" src="../img/bilibili.png"/>
            </a>
            <a href="https://mail.163.com/">
                <img class="adminicon" src="../img/163.png"/>
            </a>
            <hr>
            <h3>热门话题</h3>
            <ul class="list-group">
                <li class="list-group-item"  th:each="question:${topquestion}">
                    <a th:href="@{'/question/'+${question.id}}" th:text="${question.title}"></a>
                </li>
            </ul>

        </div>
    </div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>